x86/kexec: fix very old regression and make compatible with modern Linux
authorKeir Fraser <keir@xen.org>
Sun, 24 Oct 2010 12:15:06 +0000 (13:15 +0100)
committerKeir Fraser <keir@xen.org>
Sun, 24 Oct 2010 12:15:06 +0000 (13:15 +0100)
c/s 13829 lost the (32-bit only) cpu_has_pae argument passed to the
primary kernel's stub (in the 32-bit Xen case only), and Linux
2.6.27/.30 (32-/64-bit) introduced a new argument (for KEXEC_JUMP)
which for now simply gets passed a hardcoded value.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/machine_kexec.c
xen/arch/x86/x86_64/compat_kexec.S
xen/include/asm-x86/cpufeature.h

index d3f146854fab113207473573a850e79708871d16..9e5e7abda5eb8f7084eee18979c0f97995fb8fc0 100644 (file)
 typedef void (*relocate_new_kernel_t)(
                 unsigned long indirection_page,
                 unsigned long *page_list,
-                unsigned long start_address);
+                unsigned long start_address,
+#ifdef __i386__
+                unsigned int cpu_has_pae,
+#endif
+                unsigned int preserve_context);
 
 extern int machine_kexec_get_xen(xen_kexec_range_t *range);
 
@@ -121,7 +125,11 @@ void machine_kexec(xen_kexec_image_t *image)
 
         rnk = (relocate_new_kernel_t) image->page_list[1];
         (*rnk)(image->indirection_page, image->page_list,
-               image->start_address);
+               image->start_address,
+#ifdef __i386__
+               1 /* cpu_has_pae */,
+#endif
+               0 /* preserve_context */);
     }
 }
 
index 6977e3eb5aa26ecbb5710ff74fc1e567f0977e35..fc92af9c5e1d32f72b9d607b1dcffca35b9cae2d 100644 (file)
@@ -119,6 +119,7 @@ compatibility_mode:
         movl %eax, %ss
 
         /* Push arguments onto stack. */
+        pushl $0   /* 20(%esp) - preserve context */
         pushl $1   /* 16(%esp) - cpu has pae */
         pushl %ecx /* 12(%esp) - start address */
         pushl %edx /*  8(%esp) - page list */
index cd14b3b268040dbd7987d9a48e12ad0b1d78fc81..09d8307fca9e732f3016d710d082193dbff5a3c3 100644 (file)
 #define cpu_has_de             boot_cpu_has(X86_FEATURE_DE)
 #define cpu_has_pse            boot_cpu_has(X86_FEATURE_PSE)
 #define cpu_has_tsc            boot_cpu_has(X86_FEATURE_TSC)
-#define cpu_has_pae            boot_cpu_has(X86_FEATURE_PAE)
 #define cpu_has_pge            boot_cpu_has(X86_FEATURE_PGE)
 #define cpu_has_pat            boot_cpu_has(X86_FEATURE_PAT)
 #define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)
 #define cpu_has_de             1
 #define cpu_has_pse            1
 #define cpu_has_tsc            1
-#define cpu_has_pae            1
 #define cpu_has_pge            1
 #define cpu_has_pat            1
 #define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)